package org.bigjava.biz.impl;

import org.bigjava.bean.Compliant;
import org.bigjava.biz.CompliantService;
import org.bigjava.mapper.CompliantMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service("compliantService")
public class CompliantServiceImpl implements CompliantService {

    @Qualifier("compliantMapper")
    @Autowired
    CompliantMapper compliantMapper;

    //处理投诉信息
    @Override
    public int compliantChuLi(int id) {
        return compliantMapper.compliantChuLi(id);
    }

    //根据物业公司或投诉人查询投诉信息
    @Override
    public List<Compliant> compliantSouSuo(int w_id, String tsr) {
        return compliantMapper.compliantSouSuo(w_id,tsr);
    }

    //投诉总数
    @Override
    public int compliantZong() {
        return compliantMapper.compliantZong();
    }

    //删除投诉
    @Override
    public int compliantShanChu(int id) {
        return compliantMapper.compliantShanChu(id);
    }

    //分页查询投诉信息
    @Override
    public List<Compliant> compliantFenYe(int offset, int length) {
        return compliantMapper.compliantFenYe(offset,length);
    }

    //投诉
    @Override
    public int compliantAdd(Compliant compliant) {
        Date date = new Date();
        compliant.setTssj(date);
        return compliantMapper.compliantAdd(compliant);
    }
}
